<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   <button style="height: 100px;color:red" title="提示文本" onclick="add()">点击</button>
   <div title="提示文本" style="height: 100px;color:red">
    这是div
   </div>
   <script>
    function add(){
        console.log("add");
    }
    // var obj = {
    //     fun:function(){
    //         console.log("---");
    //     }
    // }
    var div = document.querySelector("div");
    // div.style.height = "100px";
    // div.style = "color:red";
    // div.title = "aaa";

    div.onclick = function(){
        console.log("------");
    }


   </script>
</body>
</html>